package com.atguigu.srb.base.listener;

import java.util.EventObject;

public class AnimalEvent extends EventObject {
    public AnimalEvent(Object source) {
        super(source);
        Animal animal = (Animal) source;
        System.out.println("2 " + animal.getName() + " 2");
//        try {
//            Animal animal = (Animal) source;
//            Thread.sleep(4000);
//            System.out.println("event: Generate event —— " + animal.getName() + " is eating!");
//        }catch (Exception e){
//            System.out.println(2);
//        }
    }
}
